package com.dmy.chat.server.netty.command;

/**
 * create by YCQ for 2020/1/15 11:59
 */
public enum EventType {

    /**
     * 登录
     */
    LOGIN(10),
    /**
     * 发送聊天消息
     */
    CHAT_SEND(20),
    /**
     * 接收聊天消息
     */
    CHAT_FRIEND(21);

    private int type;

    public int getType() {
        return type;
    }

    EventType(int type) {
        this.type = type;
    }

    public static EventType valueOf(int val) {
        for (EventType value : EventType.values()) {
            if (value.type == val) {
                return value;
            }
        }
        return null;
    }
}
